Hitch angle detection for trailer backup assist system

ABSTRACT

A system for detecting a hitch angle between a vehicle and a trailer is provided herein. An imaging device is configured to capture images of the trailer and a controller is configured to process images captured by the imaging device. The controller derives a template image having a trailer contour and matches the template image to a search image. The hitch angle is determined based on a positional relationship between the template image and the search image.

FIELD OF THE INVENTION

The present invention generally relates to trailer backup assistsystems, and more particularly, to trailer backup assist systemsemploying hitch angle detection through image processing.

BACKGROUND OF THE INVENTION

Reversing a vehicle while towing a trailer can be challenging for manydrivers, particularly for drivers that drive with a trailer on aninfrequent basis or with various types of trailers. Some systems used toassist a driver in backing a trailer rely on hitch angle measurements todetermine the position of the trailer relative to the vehicle. Thus, theaccuracy and reliability of the hitch angle measurements can be criticalto the operation of the trailer backup assist system.

SUMMARY OF THE INVENTION

According to one aspect of the present invention, a system for detectinga hitch angle between a vehicle and a trailer is provided. An imagingdevice is configured to capture images of the trailer and a controlleris configured to process images captured by the imaging device. Thecontroller derives a template image having a trailer contour and matchesthe template image to a search image. The hitch angle is determinedbased on a positional relationship between the template image and thesearch image.

According to another aspect of the present invention, a system fordetecting a hitch angle between a vehicle and a trailer is provided. Animaging device is configured to capture images of the trailer and acontroller is configured to process images captured by the imagingdevice. The controller derives a template image having a trailer contourand rotates the template image relative to a search image about animaged hitch point that is common to the template image and the searchimage. The controller determines the hitch angle based on an angle atwhich the template image is rotated relative to the search image togenerate a match therebetween.

According to yet another aspect of the present invention, a method fordetecting a hitch angle between a vehicle and a trailer is provided. Themethod includes the steps of capturing images of the trailer using animaging device and providing a controller that is configured to processimages captured by the imaging device. The controller derives a templateimage having a trailer contour and matches the template image to asearch image. The hitch angle is determined based on a positionalrelationship between the template image and the search image.

These and other features, advantages, and objects of the presentinvention will be further understood and appreciated by those skilled inthe art by reference to the following specification, claims, andappended drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

In the drawings:

FIG. 1 is a top perspective view of a vehicle attached to a trailer withone embodiment of a hitch angle sensor for operating a trailer backupassist system;

FIG. 2 is a block diagram illustrating one embodiment of the trailerbackup assist system having a steering input device, a curvaturecontroller, and a trailer braking system;

FIG. 3 is a flow diagram of a method of detecting a hitch angle,according to one embodiment;

FIG. 4 is a captured image showing a trailer in straight alignment witha vehicle and the presence of ground noise;

FIG. 5 is an edge map of the captured image shown in FIG. 4;

FIG. 6 illustrates the blurring of ground noise in an averaged image;

FIG. 7 is an edge map of the averaged image shown in FIG. 6;

FIG. 8 illustrates a trailer contour of a template image;

FIG. 9 illustrates a template image being matched to a search image todetermine a hitch angle;

FIG. 10 is a search image having a proximity zone for jackknifedetection and a number of candidate hitch point locations about which atemplate image can be rotated to determine an actual imaged hitch pointand a hitch angle;

FIG. 11 is a flow diagram of a method of detecting a hitch angle,according to another embodiment;

FIG. 12 is an edge map of a captured image showing a number of candidatelines, one of which, is selected to determine a hitch angle based on itsangular position relative to a reference line;

FIG. 13 is a flow diagram of a method of locating an imaged hitch point,according to one embodiment;

FIGS. 14 and 15 are each captured images in which a trailer appears at adistinct hitch angle and a detection window is used to scan an imageddrawbar to locate an imaged hitch point;

FIG. 16 is a graph illustrating averaged pixel differences for a numberof pixel positions common to the captured images shown in FIGS. 14 and15;

FIG. 17 is a kinematic model of the vehicle and trailer shown in FIG. 1;

FIG. 18 is a flow diagram of a method of detecting a hitch angle,according to yet another embodiment; and

FIG. 19 is a flow diagram of a method of initializing hitch angledetection, according to one embodiment.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

For purposes of description herein, it is to be understood that thedisclosed trailer backup assist system and the related methods mayassume various alternative embodiments and orientations, except whereexpressly specified to the contrary. It is also to be understood thatthe specific devices and processes illustrated in the attached drawings,and described in the following specification, are simply exemplaryembodiments of the inventive concepts defined in the appended claims.While various aspects of the trailer backup assist system and therelated methods are described with reference to a particularillustrative embodiment, the disclosed invention is not limited to suchembodiments, and additional modifications, applications, and embodimentsmay be implemented without departing from the disclosed invention.Hence, specific dimensions and other physical characteristics relatingto the embodiments disclosed herein are not to be considered aslimiting, unless the claims expressly state otherwise.

As used herein, the term “and/or,” when used in a list of two or moreitems, means that any one of the listed items can be employed by itself,or any combination of two or more of the listed items can be employed.For example, if a composition is described as containing components A,B, and/or C, the composition can contain A alone; B alone; C alone; Aand B in combination; A and C in combination; B and C in combination; orA, B, and C in combination.

Referring to FIGS. 1 and 2, reference numeral 10 generally designates atrailer backup assist system for controlling a backing path of a trailer12 attached to a vehicle 14 by allowing a driver of the vehicle 14 tospecify a desired curvature of the backing path of the trailer 12. Thevehicle 14 is embodied as a pickup truck that is is pivotally attachedto one embodiment of the trailer 12 that has a box frame 16 with anenclosed cargo area 18, a single axle 20 operably coupled to wheels 22and 24, and a tongue 26 longitudinally extending forward from theenclosed cargo area 18. The illustrated trailer 12 also has a trailerhitch connector in the form of a coupler assembly 28 that is connectedto a vehicle hitch connector in the form of a hitch ball 30 and drawbar31. The coupler assembly 28 latches onto the hitch ball 30 to provide apivoting hitch point 32 that allows for articulation of a hitch anglebetween the vehicle 14 and the trailer 12. As defined herein, the hitchangle corresponds to the angle formed between the center longitudinalaxis of the vehicle 14 and of the trailer 12 (see hitch angle γ; FIG.17). It should be appreciated that additional embodiments of the trailer12 may alternatively couple with the vehicle 14 to provide a pivotingconnection, such as by connecting with a fifth wheel connector. It isalso contemplated that additional embodiments of the trailer 12 mayinclude more than one axle and may have various shapes and sizesconfigured for different loads and items, such as a boat trailer or aflatbed trailer.

The trailer backup assist system 10 also includes an imaging device 34located at the rear of the vehicle 14 and configured to image arear-vehicle scene. The imaging device 34 may be centrally located at anupper region of a vehicle tailgate 35 such that the imaging device 34 iselevated relative to the tongue 26 of the trailer 12. The imaging device34 has a field of view 36 located and oriented to capture one or moreimages that may include the tongue 26 of the trailer 12 and the hitchball 30, among other things. Captured images are supplied to acontroller 38 of the trailer backup assist system 10 and are processedby the controller 38 to determine the hitch angle between the vehicle 14and the trailer 12, as will be described in greater detail herein. Thecontroller 38 is configured with a microprocessor 40 and/or other analogand/or digital circuitry for processing one or more logic routinesstored in a memory 42. The logic routines may include one or more hitchangle detection routines 44 and an operating routines 46. Informationfrom the imaging device 34 or other components of the trailer backupassist system 10 can be supplied to the controller 38 via acommunication network of the vehicle 14, which can include a controllerarea network (CAN), a local interconnect network (LIN), or otherconventional protocols used in the automotive industry. It should beappreciated that the controller 38 may be a stand-alone dedicatedcontroller or may be a shared controller integrated with the imagingdevice 34 or other component of the trailer backup assist system 10 inaddition to any other conceivable onboard or off-board vehicle controlsystems.

With respect to the present embodiment, the controller 38 of trailerbackup assist system 10 may be configured to communicate with a varietyof vehicle equipment. The trailer backup assist system 10 may include avehicle sensor module 48 that monitors certain dynamics of the vehicle14. The vehicle sensor module 48 may generate a plurality of signalsthat are communicated to the controller 38 and may include a vehiclespeed signal generated by a speed sensor 50 and a vehicle yaw ratesignal generated by a yaw rate sensor 52. A steering input device 54 maybe provided to enable a driver to control or otherwise modify thedesired curvature of the backing path of the trailer 12. The steeringinput device 54 may be communicatively coupled to the controller 38 in awired or wireless manner and provides the controller 38 with informationdefining the desired curvature of the backing path of the trailer 12. Inresponse, the controller 38 processes the information and generatescorresponding steering commands that are supplied to a power assiststeering system 56 of the vehicle 14. In one embodiment, the steeringinput device 54 includes a rotatable knob 58 operable between a numberof rotated positions that each provide an incremental change to thedesired curvature of the backing path of the trailer 12.

According to one embodiment, the controller 38 of the trailer backupassist system 10 may control the power assist steering system 56 of thevehicle 14 to operate the steered wheels 60 of the vehicle 14 for movingthe vehicle 14 in such a manner that the trailer 12 reacts in accordancewith the desired curvature of the backing path of the trailer 12. Thepower assist steering system 56 may be an electric power-assistedsteering (EPAS) system that includes an electric steering motor 62 forturning the steered wheels 60 to a steering angle based on a steeringcommand generated by the controller 38, whereby the steering angle maybe sensed by a steering angle sensor 64 of the power assist steeringsystem 56 and provided to the controller 38. The steering command may beprovided for autonomously steering the vehicle 14 during a backupmaneuver and may alternatively be provided manually via a rotationalposition (e.g., a steering wheel angle) of a steering wheel 66 or therotatable knob 58. However, in some embodiments, the steering wheel 66of the vehicle 14 may be mechanically coupled with the steered wheels 60of the vehicle 14, such that the steering wheel 66 moves in concert withsteered wheels 60 via an internal torque, thereby preventing manualintervention with the steering wheel 66 during autonomous steering ofthe vehicle 14. In such instances, the power assist steering system 56may include a torque sensor 68 that senses torque (e.g., gripping and/orturning) on the steering wheel 66 that is not expected from autonomouscontrol of the steering wheel 68 and therefore indicative of manualintervention by the driver. In some embodiments, external torque appliedto the steering wheel 66 may serve as a signal to the controller 38 thatthe driver has taken manual control and for the trailer backup assistsystem 10 to discontinue autonomous steering functionality.

The controller 38 of the trailer backup assist system 10 may alsocommunicate with a vehicle brake control system 70 of the vehicle 14 toreceive vehicle speed information such as individual wheel speeds of thevehicle 14. Additionally or alternatively, vehicle speed information maybe provided to the controller 38 by a powertrain control system 72and/or the speed sensor 50, among other conceivable means. It isconceivable that individual wheel speeds may be used to determine avehicle yaw rate, which can be provided to the controller 38 in thealternative, or in addition to, the vehicle yaw rate measured by yawrate sensor 52 of the vehicle sensor module 48. In some embodiments, thecontroller 38 may provide braking commands to the vehicle brake controlsystem 70, thereby allowing the trailer backup assist system 10 toregulate the speed of the vehicle 14 during a backup maneuver of thetrailer 12. It should be appreciated that the controller 38 mayadditionally or alternatively regulate the speed of the vehicle 14 viainteraction with the powertrain control system 72.

Through interaction with the power assist steering system 56, thevehicle brake control system 70, and/or the powertrain control system 72of the vehicle 14, the potential for unacceptable trailer backupconditions can be reduced. Examples of unacceptable trailer backupconditions include, but are not limited to, a vehicle over-speedcondition, a high hitch angle rate, hitch angle dynamic instability, atrailer jackknife condition, sensor failure, and the like. In suchcircumstances, the driver may be unaware of the failure until theunacceptable trailer backup condition is imminent or already happening.Therefore, it is disclosed herein that the controller 38 of the trailerbackup assist system 10 can generate an alert signal corresponding to anotification of an actual, impending, and/or anticipated unacceptabletrailer backup condition, and prior to driver intervention, generate acounter measure to prevent such an unacceptable trailer backupcondition.

According to one embodiment, the controller 38 may communicate with oneor more devices, including a vehicle alert system 74, which may promptvisual, auditory, and tactile warnings. For instance, vehicle brakelights 76 and vehicle emergency flashers may provide a visual alert anda vehicle horn 78 and/or speaker 80 may provide an audible alert.Additionally, the controller 38 and/or vehicle alert system 74 maycommunicate with a human machine interface (HMI) 82 of the vehicle 14.The HMI 82 may include a touchscreen vehicle display 84 such as acenter-stack mounted navigation or entertainment display capable ofdisplaying images indicating the alert. Such an embodiment may bedesirable to notify the driver of the vehicle 14 that an unacceptabletrailer backup condition is afoot. Further, it is contemplated that thecontroller 38 may communicate via wireless communication with one ormore electronic portable devices such as portable electronic device 86,which is embodied as a smartphone. The portable electronic device 86 mayinclude a display 88 for displaying one or more images and otherinformation to a user. In response, the portable electronic device 86may provide feedback information, such as visual, audible, and tactilealerts.

Referring to FIG. 3, a method of detecting hitch angle is illustrated.The method, also referred to herein as “the template matching method,”may be executed by the controller 38 of the trailer backup assist system10 and is shown as one embodiment of the hitch angle detection routine44. The template matching method generally includes processing imageinformation to distinguish trailer contour from ground noise in imagescaptured by the imaging device 34. The trailer contour then serves as atemplate and is matched to a search image to determine the hitch anglebetween the vehicle 14 and the trailer. 12

For purposes of illustration, a captured image 90 is exemplarily shownin FIG. 4 illustrating the trailer 12 in straight alignment with thevehicle 14 and the presence of ground noise. As defined herein, groundnoise generally corresponds to any ground structure capable ofinterfering with image acquisition of the trailer 12. With respect tothe captured image 90, potential ground noise candidates may includelarge stones (e.g., stone 92) and irregular ground surfaces (e.g.,ground surface 94). As such, it may be difficult to accurately identifythe trailer 12 when an image acquisition technique, namely edgedetection, is applied to the captured image 90, as exemplarily shown inFIG. 5. With these things in mind, the template matching methoddescribed herein is able to blur out ground noise to enableidentification of one or more trailer contours. Once identified, thetrailer contour(s) may be stored as a template image that is matched toa search image to determine the hitch angle between the vehicle 14 andthe trailer 12. In practice, the method has been found highly robust andbenefits from relatively fast and straightforward computations.

The template matching method may begin at step 100, where the driver orother occupant initiates the trailer backup assist system 10. This maybe achieved via user-input made through the display 84 of the vehicle 14or other conceivable means. At step 110, the driver is instructed topull the trailer 12 in a straight direction such that the hitch anglebetween the vehicle 14 and the trailer 12 is substantially zero. Whilethe vehicle 14 and trailer 12 are engaged in the straight pull maneuver,the controller 38 derives an averaged image of all images captured bythe imaging device 34 during a period of time at step 120. It has beendiscovered that 1-3 seconds typically suffices. Notably, the trailer 12appears stationary within the images captured by the imaging device 34whereas ground noise constantly changes from image to image. Thus, withrespect to the averaged image, pixels associated with the trailer 12will keep their contrast whereas pixels associated with ground noisewill be blurred. To illustrate this effect, an averaged image 125 isexemplarily shown in FIG. 6.

At step 130, the controller 38 derives an edge map of the averaged imageby calculating the intensity gradient for each pixel of the averagedimage 125. The intensity gradient, or edge value, of each pixel mayrange from 0 to 255. For purposes of illustration, an edge map 135 isexemplarily shown in FIG. 7, in which the edge values of pixelsassociated with ground noise have been substantially weakened due to theblurring effect. At step 140, the controller 38 compares the edge valueof each pixel of the edge map 135 to a threshold value (e.g., 30).Pixels having an edge value meeting or exceeding the threshold value areidentified as trailer pixels whereas pixels having an edge value notmeeting or exceeding the threshold value are identified as ground noisepixels. Once the trailer pixels have been identified, the controller 38determines one or more trailer contours at step 150. The trailercontour(s) are saved to the memory 42 of the controller 38 as a templateimage at step 160 and may include a substantial entirety of the imagedtrailer 12 or portions thereof. For purposes of illustration, a trailercontour 152 is shown in FIG. 8. As shown, the trailer contour 152 has asquare shape, which is generally more computationally efficient. In itscurrent position, the trailer contour 152 may serve as a zero hitchangle reference and enables the hitch angle between the vehicle 14 andthe trailer 12 to be determined in subsequent images (i.e., searchimages) via template matching at step 170.

According to one embodiment, as shown in FIG. 9, the hitch angle betweenthe vehicle 14 and the trailer 12 may be determined based on apositional relationship between a template image 158 and a search image171. More specifically, the hitch angle may be determined bysuperimposing the template image 158 over the search image 171 such thatthe template image 158 is initially in a zero hitch angle position andsubsequently rotating the template image 158 about a rotation point,preferably the imaged hitch point 172. The direction of rotation can bepredicted based on information received from the steering angle sensor64 or other sensors from which an initial assessment can be madeconcerning the angular position of the trailer 12 relative to thevehicle 14. Once the template image 158 has been matched to the searchimage 171, the angle θ at which the template image 158 is rotatedrelative to the zero hitch angle position can be correlated to the hitchangle between the vehicle 14 and the trailer 12.

According to one embodiment, the imaged hitch point 172 may bedetermined through process of elimination. For instance, as exemplarilyshown in FIG. 10, the controller 38 may define a number of candidatehitch point locations 173 a-173 d that are positioned along a referenceline 174 that extends vertically across the middle column of the searchimage 171. The reference line 174 is defined by the controller 38 and isassumed to coincide with the center longitudinal axis of an imageddrawbar 175 and intersect with the hitch point 172 of the imaged vehicle14 and trailer 12. The candidate hitch point locations 173 a-173 d areshown evenly spaced along the reference line 174 but may vary in numberand spacing in other embodiments. Once the template image 158 has beenderived and the vehicle 14 and trailer 12 are moving along a curvedpath, the controller 38 may superimpose the template image 158 onto thesearch image 171 at the zero hitch angle position and rotate thetemplate image 158 about each of the candidate hitch point locations 173a-173 d in an attempt to match the template image 158 with the searchimage 171. Based on the match quality, a confidence score is given toeach candidate hitch point location 173 a-173 d and the candidate hitchpoint location 173 a-173 d receiving the highest confidence score isselected as the hitch point. In the event the matching qualityassociated with each candidate hitch point location 173 a-173 d is belowa predetermined threshold, the controller 38 may define additionalcandidate hitch point locations (not shown) along the reference line 174in either or both directions of the candidate hitch point location 173a-173 d that received the highest confidence score and execute templatematching with respect to each of the additional candidate hitch pointlocations. This process may be iterated as many times as needed untilthe predetermined threshold has been met. In so doing, the location ofthe candidate hitch point location that is ultimately selected as theimaged hitch point will closely mirror the location of the actual hitchpoint 172.

While matching the template image 158 to the search image 171, thecontroller 38 may additionally determine the presence of an imminentjackknife scenario at step 180. With continued reference to FIG. 10, thedisplacement of the template image 158 may be monitored relative to aproximity zone 182 while the template image 158 is rotated about therotation point. In the illustrated embodiment, the proximity zone 182may be defined as the space between an imaged rear bumper 184 of thevehicle 14 and a boundary line 186 that is defined by the controller 38and overlaid onto the search image 171. The boundary line 186 may bev-shaped and includes a pair of straight segments 188 extendingoutwardly at an angle from a point 189 that is located on the referenceline 174 and is disposed between the imaged hitch point 172 and theimaged rear bumper 184. It should be appreciated that the boundary line186 may assume other shapes in alternative embodiments. The location andshape of the boundary line 186 may be determined based on variousconsiderations such as, but not limited to, vehicle speed, trailerlength, drawbar length, imager characteristics, trailer contour, andvehicle contour. It is generally assumed that vehicle speed, trailerlength, drawbar length, and image characteristics are known or may beotherwise measured and inputted to the trailer backup assist system 10.Vehicle contour, such as that of the imaged rear bumper 184, may beprogrammed at the factory.

In the event the template image 158 crosses into the proximity zone 182of the search image 171, the controller 38 determines that an imminentjackknife scenario is present and initiates a jackknife countermeasureat step 190. Otherwise, if it is determined that an imminent jackknifescenario is not present, the controller 38 may continue to determine thehitch angle between the vehicle 14 and the trailer 12, as discussedpreviously with respect to step 170. The jackknife countermeasure mayinclude generating an auditory warning via the vehicle alert system 74,generating a visual warning via the display 84, generating a brakingcommand to the vehicle brake control system 70, reducing the torque ofthe powertrain control system 72, modifying the steering angle of thevehicle 14, or a combination thereof in addition to any otherconceivable countermeasures. Since the trailer 12 will likely be inmotion upon the controller 38 determining that an imminent jackknifescenario is present, it is generally desirable to locate and dimensionthe proximity zone 182 in a manner that provides sufficient time for ajackknife scenario to be detected and a countermeasure to beimplemented, thereby minimizing the potential of an actual jackknifingand/or collision between the trailer 12 and the vehicle 14. Doing soalso overcomes any response latency that may be inherent in the trailerbackup assist system 10. While steps 170 and 180 have been illustratedin a linear fashion, it should be appreciated that both steps may beperformed simultaneously.

Referring to FIG. 11, another method of detecting hitch angle isillustrated. The method, also referred to herein as “the centerlinemethod,” may be executed by the controller 38 of the trailer backupassist system 10 and is exemplarily shown as one embodiment of the hitchangle detection routine 44. The centerline method also utilizes imageinformation obtained by processing images captured by the imaging device34 to determine the hitch angle between the vehicle 14 and the trailer12. The centerline method differs from the template matching method inthat the vehicle 14 and the trailer 12 need not be moving a straightdirection prior to hitch angle detection, thus making the centerlinemethod particularly useful in instances where no template image isavailable for the trailer 12 and the driver is prevented from pullingthe trailer 12 in a straight line. When compared to the templatematching method, the centerline method generally benefits from fasterprocessing times, but is also generally less reliable. Therefore, it canbe said that the centerline method provides a quick start to hitch angledetection and may be replaced at a later time by the template matchingmethod or other suitable methods providing more reliable hitch anglemeasurements. Thus, for purposes of illustration, the centerline methodwill be described in greater detail below under the condition that notemplate image is available and that the vehicle 14 and trailer 12 areinitially moving along a curved path.

The centerline method may begin at step 200, where the controller 38processes successive images captured by the imaging device 34 to derivean averaged image. At step 210, the controller 38 derives an edge map bycalculating an intensity gradient, or edge value, for each pixel in theaveraged image. At step 220, the controller 38 identifies trailer pixelsin the edge map by comparing the edge value of each pixel to a thresholdvalue and selecting only those pixels meeting or exceeding the thresholdvalue to correspond to trailer pixels. For purposes of illustration, anedge map 222 is exemplarily shown in FIG. 12, wherein one embodiment ofthe imaged trailer 12 appears slightly blurred as a result of angulardisplacement of the trailer 12 relative to the vehicle 14. It iscontemplated that additional threshold values may be used todifferentiate between trailer pixels and vehicle pixels since vehiclepixels will generally have a higher degree of contrast relative totrailer pixels due to the blurring of the trailer 12. At step 230, thecontroller 38 defines a number of candidate lines on the edge map 222,as exemplarily shown in FIG. 12. The candidate lines project outwardlyfrom a common projection point, preferably the imaged hitch point 232.The direction at which the candidate lines project may vary based on awidth of the rear bumper of the vehicle 14, a length of the drawbar ofthe vehicle 14, and a length of the tongue of the trailer 12. In theillustrated embodiment, the candidate lines may vary from −90 degrees to90 degrees with respect to a reference line 234 that is indicative of apredetermined hitch angle (e.g., a zero hitch angle) and extendsvertically across the middle column of the edge map 222 and intersectsthe imaged hitch point 232. While the exact location of the imaged hitchpoint 232 may be unknown initially, the controller 38 may assign adefault projection point from which to project the candidate lines.Since it's assumed the hitch point 232 will typically be located alongthe reference line 234 and usually falls within a predictable range(e.g., 10-20 centimeters from the rear bumper of the vehicle 14), theselection of a default projection point meeting the foregoing criteriais generally sufficient for the purposes of initial hitch angledetection.

At step 240, the controller 38 selects the candidate line (e.g.,candidate line 242) having approximately the same number of trailerpixels on each of its sides, or said differently, the candidate line, orcenterline, about which the trailer pixels are substantially symmetric.Once the controller 38 has made a candidate line selection, thecontroller 38 may determine the hitch angle between the vehicle 14 andthe trailer 12 based on the angular position of the selected candidateline 242 relative to the reference line 234 at step 250. Morespecifically, the angle θ between the selected candidate line 242 andthe reference line 234 can be correlated to the hitch angle between thevehicle 14 and the trailer 12. As the vehicle 14 and trailer 12 continuealong its course, steps 200-250 may be iterated with subsequent imagescaptured by the imaging device 34 to continually provide hitch anglemeasurements.

Referring to FIG. 13, a method of locating an imaged hitch point inimages captured by the imaging device 34 is illustrated. The method,also referred to herein as “the drawbar scan method,” may be executed bythe controller 38 of the trailer backup assist system 10 and may beembodied as a subroutine of the hitch angle detection routine 44. Thedrawbar scan method generally requires the trailer 12 to be movingrelative to the vehicle 14 at a non-zero hitch angle in order toidentify an imaged hitch point. As such, the drawbar scan method may beexecuted to provide a suitable rotation point or projection point whenexecuting the centerline method or the template matching method ininstances where the vehicle 14 and trailer 12 are moving along a curvedpath. By identifying the imaged hitch point, more accurate hitch anglemeasurements can be achieved.

The drawbar scan method generally begins at step 300, where thecontroller 38 selects two images captured by the imaging device 34 thatshow the trailer 12 at distinct hitch angles. The two images may besuccessive or non-successive depending on the frame rate of the imagingdevice 34. In practice, a noticeable difference in hitch angles betweenthe two images is generally preferred. At step 310, the controller 38derives an edge map for both images by calculating the intensitygradient, or edge value, for each of their corresponding pixels. Forpurposes of illustration, FIG. 14 shows a first image 312 in which thehitch angle between the vehicle 14 and the trailer 12 is approximatelyzero whereas FIG. 15 shows a second image 314 in which the hitch anglebetween the vehicle 14 and the trailer 12 is approximately 5 degreesrelative to the zero hitch angle position shown in FIG. 14. For purposesof clarity, the edge maps associated with both images 312, 314 are notshown. At step 320, the controller 38 defines a detection window 322 ofvariable height and width in both images 312, 314. Each detection window322 is centered at a common pixel position, such as pixel position 324,which is located on a reference line 326 that extends vertically acrossthe middle column of the corresponding image 312, 314. The referenceline 326 is defined by the controller 38 and is assumed to coincide withthe center longitudinal axis of an imaged drawbar 327 and intersect withan imaged hitch point 328 between the vehicle 14 and the trailer 12.

At step 330, the controller 38 determines an average pixel intensity ofthe pixels bounded by each detection window 322 when centered at thecurrent pixel position, and at step 340, the controller 38 calculates anaveraged pixel difference, which is defined herein as the absolute valueof the difference between the average pixel intensities, as calculatedat step 330. Once the average pixel difference has been calculated, atstep 350, the controller 38 shifts each detection window 322 in anupward vertical direction (as specified by arrow 342) so that eachdetection window 322 is commonly centered at a new pixel position thatis 1 or more pixel positions higher on the corresponding reference line326 than the previous pixel position. Thus, by making multipleiterations of steps 330-350, the controller 38 may calculate averagedpixel differences for when each detection window 322 is commonlycentered at a number of pixel positions along the reference line 326.Once this has been done, at step 360, the controller 38 extrapolates thelocation of the hitch point 328 based on variations in the calculatedaveraged pixel differences.

With respect to images 312 and 314, it is generally expected that littlevariation will occur between the calculated averaged pixel differencesassociated with pixel positions that coincide with the imaged drawbar327 due in part to the imaged drawbar 327 appearing in a common fixedposition in both images 312, 314. In contrast, it is generally expectedthat greater variation to occur between the calculated averaged pixeldifferences associated with pixel positions that are located on portionsof the reference line 326 that extend beyond the imaged drawbar 327 duein part to the trailer 12 appearing in different positions in bothimages 312, 314. For purposes of illustration, a graph is shown in FIG.16 illustrating calculated averaged pixel differences for a number ofpixel positions along the vertical reference line 326. The pixelpositions may fall within a predetermined range in which the imagedhitch point 328 is expected to be located, thereby negating the need todetermine averaged pixel differences for pixel positions along thevertical reference line 326 that are unlikely to correspond to theimaged hitch point 328.

As shown in FIG. 16, the graph generally demonstrates a relativelyconstant averaged pixel difference between 2 and 3 when each detectionwindow 322 is commonly centered at pixel positions 0-44 as those pixelpositions coincide with the imaged drawbar 327. In contrast the graph inFIG. 15 generally demonstrates a sharp increase in averaged pixeldifferences when each detection window 322 is commonly centered at pixelpositions 46-70 as those pixel positions are located on portions of thereference line 326 that extend past the imaged drawbar 327. Recognizingthis, the controller 38 may select, as the imaged hitch point 328, oneof the pixel positions (e.g., pixel position 44 or 45) leading up to thesharp increase in averaged pixel differences. According to oneembodiment, the controller 38 may iterate steps 330-350 of the drawbarscan method until the averaged pixel difference meets or exceeds apredetermined threshold value (e.g., 3.5) and select, as the imagedhitch point, the pixel position associated with the calculated averagedpixel difference that meets or exceeds the threshold value. Thisthreshold value may be determined based on a number of considerationsincluding, but not limited to, the size of the detection window 322,properties of the imaging device 34, etc. Once identified, the selectedimaged hitch point should closely mirror the actual imaged hitch point328 and may be used for hitch angle detection pursuant to the templatematching method or the centerline method.

Referring to FIG. 17, a kinematic model of the vehicle 14 and trailer 12is shown and serves as the basis for determining hitch angle accordingto another method, referred to herein as “the steady state method” anddescribed in greater detail below. As shown in FIG. 17, the kinematicmodel is based on various parameters associated with the vehicle 14 andthe trailer 12. These parameters include:

δ: steering angle at steered wheels 60 of the vehicle 14;

α: yaw angle of the vehicle 14;

β: yaw angle of the trailer 12;

γ: hitch angle between the vehicle 14 and the trailer 12 (γ=β−α);

W: wheelbase length between a front axle 370 and a rear axle 372 of thevehicle 14;

L: drawbar length between the hitch point 32 and the rear axle 372 ofthe vehicle 14;

D: trailer length between the hitch point 32 and axle 20 of the trailer12 or effective axle for a multiple axle trailer; and

v: vehicle longitudinal speed.

From the kinematic model shown in FIG. 17, the yaw rate of the vehicle14 may be represented with the following equation:

$\frac{\mathbb{d}\alpha}{\mathbb{d}t} = {{- \frac{v}{W}}\tan\mspace{11mu}\delta}$

Furthermore, the yaw rate of the trailer 12 may be represented with thefollowing equation:

$\frac{\mathbb{d}\beta}{\mathbb{d}t} = {{\frac{v}{D}\sin\mspace{11mu}\gamma} + {\frac{Lv}{DW}\cos\mspace{11mu}\gamma\mspace{11mu}\tan\mspace{11mu}\delta}}$

Accordingly, when the yaw rate of the vehicle 14 and the trailer 12become equal, the hitch angle γ and the steering angle δ will beconstant. This condition, referred to herein as steady state, can occurwhen a steering command is steadily maintained during a backing maneuversuch as when the trailer 12 is reversed in a straight line with thevehicle 14 or when the vehicle 14 and trailer 12 are turning at aconstant curvature for at least a threshold period of time or over athreshold distance of motion. Under such steady state drivingconditions, the resulting hitch angle γ can be described using thefollowing equation:c=a cos γ+b sin γ

This equation can be rewritten as follows:c=a√{square root over (1−sin² γ)}+b sin γ

The above equation can be rearranged into quadratic form and rewrittenas follows:c ² −a ²−2bc sin γ+(b ² +a ²)sin γ=0

Solving the quadratic equation for the hitch angle γ yields thefollowing hitch angle equation:

$\gamma = {{arc}\;\sin\frac{{bc} \pm {a\sqrt{b^{2} + a^{2} - c^{2}}}}{b^{2} + a^{2}}}$

Where,c=−1/W tan δb=1/Da=L/DW tan δ

Accordingly, for a particular vehicle and trailer combination, thetrailer length D, the wheelbase length W, and the drawbar length L areconstant and assumed known. Thus, when the steady state condition issatisfied, the hitch angle γ between the vehicle 14 and trailer 12 maybe determined as a function of the trailer length D, the wheelbaselength W, the drawbar length L, and the steering angle δ.

Referring to FIG. 18, the steady state method is shown according to oneembodiment. The steady state method may be executed by the controller 38of the trailer backup assist system 10 and is exemplarily shown as oneembodiment of the hitch angle detection routine 44. The method includesdetermining a steering angle at step 400. The steering angle may beprovided by the steering angle sensor 64 and may be compensated toremove any offsets associated therewith. Next, at step 410, a steeringangle rate is calculated and is filtered to remove noise. At step 420,it is determined whether the absolute value of the filtered steeringangle rate is less than a threshold steering angle rate (e.g., 0.5degrees per second) required for hitch angle calculation. The methodalso includes obtaining a hitch angle between the vehicle 14 and trailer12, as measured pursuant to any of the hitch angle detection methodsdescribed herein (e.g., the centerline method) at step 430. At step 440,the controller 38 calculates a filtered hitch angle rate and determinesat step 450 whether the absolute value of the filtered hitch angle rateis less than a threshold hitch angle rate (e.g., 0.5 degrees per second)required for hitch angle calculation. The method further includesobtaining a vehicle speed (e.g., from speed sensor 50) at step 460,calculating a filtered vehicle speed at step 470, and then determiningat step 480 whether the absolute value of the filtered vehicle speed isgreater than a threshold vehicle speed (e.g., 3 kilometers per second)required for hitch angle calculation. If the conditions specified atsteps 420, 450, and 480 are met at step 490, the controller 38determines that the steady state condition has been satisfied andcalculates a hitch angle at step 500 using the hitch angle equationdescribed herein with respect to the kinematic model shown in FIG. 17.So long as the steady state condition is satisfied, the controller 38may continue to determine hitch angle via the hitch angle equation.

Referring to FIG. 19, a method of initializing hitch angle detection isillustrated. The method, referred to herein as the “hitch angleinitialization method,” may be executed by the controller 38 of thetrailer backup assist system 10 and is exemplarily shown as oneembodiment of the operating routine 46. The hitch angle initializationmethod includes selecting between the various hitch angle detectionmethods described previously herein, which include the template matchingmethod, the centerline method, and the steady state method, for thepurposes of hitch angle detection. As described in greater detail below,the foregoing hitch angle detection methods generally vary in processingtime and reliability. Thus, the hitch angle initialization method isexecuted in a manner such that the “best available” hitch angle methodis chosen based on considerations including the availability of atemplate image for the trailer 12 being towed and current drivingconditions.

The hitch angle initialization method may begin at step 600, where thecontroller 38 determines whether a template image is available for thetrailer 12 being towed. If so, the controller 38 proceeds to step 610 todetermine the hitch angle via the template matching method. The templatematching method may determine the hitch angle in approximately 1 secondand is generally the most reliable when compared to the centerlinemethod and the steady state method. So long as the template imageremains available, the template matching method is selected as the bestavailable hitch angle detection. In the event no template image isavailable or the template matching method is unable to be executed(e.g., system error), the controller 38 proceeds to step 620 todetermine whether the vehicle 14 and trailer 12 are moving in a straightdirection. According to one embodiment, the direction of the vehicle 14and trailer 12 may be determined by obtaining a steering angle from thesteering angle sensor 64 over a period of time. If it is determined thatthe vehicle 14 and trailer 12 are moving in a straight direction, thecontroller 38 proceeds to step 625 and processes images captured by theimaging device 34 to derive a template image of the trailer 12 beforeproceeding to step 610 to determine the hitch angle via the templatematching method. Otherwise, the controller 38 proceeds to step 630 todetermine the hitch angle via the centerline method. The centerlinemethod may determine the hitch angle in less than 1 second but isgenerally less reliable when compared to the template matching methodand the steady state method.

Once the centerline method is selected, the controller 38 will continueto determine the hitch angle via the centerline method until a steadystate condition is satisfied at step 640. As described previouslyherein, the steady state condition may be satisfied when the vehicle 14and trailer 12 are moving in a straight direction or moving along a pathat constant curvature. Or in other words, the steady state condition issatisfied when the yaw rate of the vehicle 14 and the trailer 12 becomeequal, thereby resulting in the hitch angle and the steering anglebecoming constant. If the steady state condition is satisfied, thecontroller proceeds to step 650, where it determines whether the hitchangle is substantially zero. In instances where the steady statecondition is satisfied due to the vehicle 14 and trailer 12 moving in astraight direction at a constant zero hitch angle value (γ=0), thecontroller 38 proceeds to step 625 and processes images captured by theimaging device 34 to derive a template image of the trailer 12 beforeproceeding to step 610 to determine the hitch angle via the templatematching method. Otherwise, in instances where the steady statecondition is satisfied due to the vehicle 14 and trailer 12 moving alonga path at a constant non-zero hitch angle value (λ≠0), the controllerproceeds to step 660 to determine the hitch angle via the steady statemethod. The steady state method may determine the hitch angle inapproximately 1-3 seconds and is generally less reliable than thetemplate matching method but more reliable than the centerline method.So long as the steady state condition is satisfied, the controller 38will select either the template matching method or the steady statemethod. If the steady state method is the currently selected hitch angledetection method and the steady state condition is no longer satisfied,the controller 38 returns to step 630 to determine the hitch angle viathe centerline method.

It is to be understood that variations and modifications can be made onthe aforementioned structures and methods without departing from theconcepts of the present invention, and further it is to be understoodthat such concepts are intended to be covered by the following claimsunless these claims by their language expressly state otherwise.

The invention claimed is:
 1. A system for detecting a hitch anglebetween a vehicle and a trailer, comprising: an imaging deviceconfigured to capture images of the trailer; a controller configured to:process images captured by the imaging device; derive a template imagehaving a trailer contour; and match the template image to a searchimage; wherein the hitch angle is determined based on a positionalrelationship between the template image and the search image; whereinthe controller matches the template image to the search image byrotating the template image relative to the search image about arotation point; and wherein the hitch angle correlates to an angle atwhich the template image is rotated relative to the search image togenerate a match therebetween.
 2. The system of claim 1, wherein thecontroller derives the template image by: deriving an averaged image ofall images captured by the imaging device during a period of time inwhich the vehicle and the trailer are moving in a straight direction;calculating an edge value for each pixel of the averaged image;comparing the edge value of each pixel to a threshold value to identifybetween trailer pixels and ground pixels; and determining the trailercontour based on identified trailer pixels.
 3. The system of claim 2,wherein pixels having edge values that meet or exceed the thresholdvalue are identified as trailer pixels and pixels having edge valuesthat do not meet or exceed the threshold value are identified as groundpixels.
 4. The system of claim 1, wherein the controller monitors thedisplacement of the trailer contour relative to a proximity zone in thesearch image and initiates a jackknife countermeasure if the trailercontour crosses into the proximity zone.
 5. The system of claim 4,wherein the proximity zone is defined as a space between an imaged rearbumper of the vehicle and a boundary line that is defined by thecontroller and is overlaid onto the search image.
 6. The system of claim4, wherein the jackknife countermeasure comprises generating an auditorywarning via a vehicle alert system, generating a visual warning via avehicle display, generating a braking command to a vehicle brake controlsystem, reducing a torque of a vehicle powertrain control system,modifying a steering angle of the vehicle, or a combination thereof. 7.A system for detecting a hitch angle between a vehicle and a trailer,comprising: an imaging device configured to capture images of thetrailer; a controller configured to: process images captured by theimaging device; derive a template image having a trailer contour; rotatethe template image relative to a search image about an imaged hitchpoint that is common to the template image and the search image; anddetermine the hitch angle based on an angle at which the template imageis rotated relative to the search image to generate a matchtherebetween.
 8. The system of claim 7, wherein the controller derivesthe template image by: deriving an averaged image of all images capturedby the imaging device during a period of time in which the vehicle andthe trailer are moving in a straight direction; calculating an edgevalue for each pixel of the averaged image; comparing the edge value ofeach pixel to a threshold value to identify between trailer pixels andground pixels; and determining the trailer contour based on identifiedtrailer pixels.
 9. The system of claim 8, wherein pixels having edgevalues that meet or exceed the threshold value are identified as trailerpixels and pixels having edge values that do not meet or exceed thethreshold value are identified as ground pixels.
 10. The system of claim7, wherein the controller monitors the displacement of the trailercontour relative to a proximity zone in the search image and initiates ajackknife countermeasure if the trailer contour crosses into theproximity zone.
 11. The system of claim 10, wherein the proximity zoneis defined as a space between an imaged rear bumper of the vehicle and aboundary line that is defined by the controller and is overlaid onto thesearch image.
 12. The system of claim 10, wherein the jackknifecountermeasure comprises generating an auditory warning via a vehiclealert system, generating a visual warning via a vehicle display,generating a braking command to a vehicle brake control system, reducinga torque of a vehicle powertrain control system, modifying a steeringangle of the vehicle, or a combination thereof.
 13. A method fordetecting a hitch angle between a vehicle and a trailer, comprising thesteps of: capturing images of the trailer using an imaging device;providing a controller configured to: process images captured by theimaging device; derive a template image having a trailer contour; andmatch the template image to a search image; wherein the hitch angle isdetermined based on a positional relationship between the template imageand the search image; wherein the controller matches the template imageto the search image by rotating the template image relative to thesearch image about a rotation point; and wherein the hitch anglecorrelates to an angle at which the template image is rotated relativeto the search image to generate a match therebetween.
 14. The method ofclaim 13, wherein the controller derives the template image by: derivingan averaged image of all images captured by the imaging device during aperiod of time in which the vehicle and the trailer are moving in astraight direction; calculating an edge value for each pixel of theaveraged image; comparing the edge value of each pixel to a thresholdvalue to identify between trailer pixels and ground pixels; anddetermining the trailer contour based on identified trailer pixels. 15.The method of claim 14, wherein pixels having edge values that exceedthe threshold value are identified as trailer pixels and pixels havingedge values that do not exceed the threshold value are identified asground pixels.
 16. The method of claim 13, wherein the controllermonitors the displacement of the trailer contour relative to a proximityzone in the search image and initiates a jackknife countermeasure if thetrailer contour crosses into the proximity zone.
 17. The method of claim16, wherein the proximity zone is defined as a space between an imagedrear bumper of the vehicle and a boundary line that is defined by thecontroller and is overlaid onto the search image.
 18. The method ofclaim 16, wherein the jackknife countermeasure comprises generating anauditory warning via a vehicle alert system, generating a visual warningvia a vehicle display, generating a braking command to a vehicle brakecontrol system, reducing a torque of a vehicle powertrain controlsystem, modifying a steering angle of the vehicle, or a combinationthereof.